<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>

    <div id="app">
        <div :style="style" @contextmenu.prevent="test">

        </div>
    </div>

<script>
    var app=new Vue({
        el:'#app',
        data: {
            style:{border:'solid 1px red',height:'300px' }
        },
        methods:{
            test(){
                alert('sadf');
            }


            },


    });

</script>
</body>
</html>